package com.wang.springbootinit.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wang.springbootinit.model.entity.Grade;
import com.wang.springbootinit.model.param.GradeParam;
import com.wang.springbootinit.model.param.GradeUpdateParam;
import com.wang.springbootinit.model.vo.GradeStudentVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface GradeService extends IService<Grade> {
    Boolean saveGrade(GradeParam param);
    Grade updateGrade(Long id, Grade grade);
    void deleteGrade(Long id);
    List<Grade> getGradeByStudentId(Long studentId);
    List<Grade> getStudentGrades(Long studentId);
    List<Grade> getStudentSemesterGrades(Long studentId, String semester);
    List<Grade> getCourseGrades(String courseName);
    int importGradesFromExcel(MultipartFile file) throws Exception;
    byte[] exportGradesToExcel(Long studentId, String semester, String courseName);

    Page<GradeStudentVO> listGrades(String className, String courseName, String semester, int page, int size);

    Map<String, List<String>> getOptions();

    Boolean updateBatch(GradeUpdateParam param);

    Map<String, List<String>> getOptionsByCurrentUser(HttpServletRequest request);

    List<Grade> getCurrentStudentGrade(HttpServletRequest request);
}